package com.zh.media.domain.dto;

import com.zh.web.base.BaseDto;
import com.zh.web.enums.Status;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(value = "新增文章参数")
public class AddArticleDto extends BaseDto implements Serializable {

    private final static long serialVersionUID = 1L;
    @ApiModelProperty(value = "标题", required = true)
    @NotEmpty(message = "标题不能为空")
    @Size(min = 5, max = 200, message = "标题长度在5字-200字间")
    private String title;
    @ApiModelProperty("副标题")
    @Max(value = 500, message = "副标题长度不能超过500字")
    private String subTitle;
    @NotEmpty(message = "作者不能为空")
    @ApiModelProperty(value = "作者", required = true)
    private String author;
    @ApiModelProperty(value = "封面")
    private String cover="http://8.137.38.55:9000/lawsweep/avatar/default_avatar.png";
    @ApiModelProperty(value = "内容", required = true)
    @NotEmpty(message = "内容不能为空")
    @Size(min = 50, max = 20000, message = "内容长度在50字-20000字间")
    private String content;
    @NotEmpty(message = "创作类型不能为空")
    @ApiModelProperty(value = "创作类型 由字典选取", required = true)
    private String creationType;
    @ApiModelProperty("来源地址 转载时提供")
    private String source;
    @NotEmpty(message = "内容类型不能为空")
    @ApiModelProperty(value = "内容类型 由字典选取", required = true)
    private String contentType;
    @NotEmpty(message = "法条类型不能为空")
    @ApiModelProperty(value = "法条类型 由字典选取", required = true)
    private String lawType;
    @ApiModelProperty(value = "文章状态 由字典选取 上传时不提供默认审核", hidden = true)
    private Status status = Status.REVIEWING;
}
